package com.obao.business.action;

import com.obao.business.entity.Business;
import com.obao.business.entity.BusinessDomain;
import com.obao.business.entity.Product;
import com.obao.business.service.IBusinessService;
import com.opensymphony.xwork2.ActionSupport;

import java.util.List;


/**
 * Created by Acey on 2016/11/21.
 */
public class BusinessAction extends ActionSupport {
    private IBusinessService businessService;
    private List<BusinessDomain> domains;
    private Business business;
    private List<Business> businessList;
    private Integer id;
    /**
     * 查找区域下全部商家列表
     */
    public String business(){
        businessList =  businessService.findBusinessList(id);
        return "businessList";
    }
    /**
     * 查找商家下全部产品
     * @return
     */
    public String findBusinessById(){
    business =  businessService.findBusinessById(business.getBusinessId());
        return "businessJson";
    }
    public Business getBusiness() {
        return business;
    }

    public void setBusiness(Business business) {
        this.business = business;
    }

    public void setBusinessService(IBusinessService businessService) {
        this.businessService = businessService;
    }

    public IBusinessService getBusinessService() {
        return businessService;
    }

    public List<BusinessDomain> getDomains() {
        return domains;
    }

    public void setDomains(List<BusinessDomain> domains) {
        this.domains = domains;
    }

    public List<Business> getBusinessList() {
        return businessList;
    }

    public void setBusinessList(List<Business> businessList) {
        this.businessList = businessList;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
}
